package com.example.demo.quartz.web;


import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.annotation.ApiDesc;
import com.example.demo.entity.base.PageRequestBean;
import com.example.demo.entity.base.PageResponseBean;
import com.example.demo.entity.base.ResponseEntity;
import com.example.demo.entity.mybatisplus.TbSysCustomQuartz;
import com.example.demo.quartz.service.MpTbSysCustomQuartzService;

/**
 * <p>
 * 自定义定时任务表 前端控制器
 * </p>
 *
 * @author xzw
 * @since 2021-04-28
 */
@RestController
@RequestMapping("/tbsyscustomquartz")
public class MpTbSysCustomQuartzController {
	@Autowired
	private MpTbSysCustomQuartzService mpTbSysCustomQuartzService;
	
	@ApiDesc("分页查询自定义定时器")
	@RequestMapping(value="/querycustomquartz")
	public Object queryCustomQuartz(HttpServletRequest request,@RequestBody PageRequestBean<TbSysCustomQuartz> pagerequest) {
		
		ResponseEntity<PageResponseBean<Map<String, Object>>> ret = mpTbSysCustomQuartzService.queryCustomQuartz(pagerequest);
		
		return ret;				
	}
	
	@ApiDesc("新增自定义定时器")
	@RequestMapping(value="/addcustomquartz")
	public Object addCustomQuartz(HttpServletRequest request,TbSysCustomQuartz tbSysCustomQuartz) {
		
		ResponseEntity<String> ret = mpTbSysCustomQuartzService.addCustomQuartz(tbSysCustomQuartz);
		
		return ret;				
	}
	
	@ApiDesc("修改自定义定时器")
	@RequestMapping(value="/updatecustomquartz")
	public Object updateCustomQuartz(HttpServletRequest request,TbSysCustomQuartz tbSysCustomQuartz) {
		
		ResponseEntity<String> ret = mpTbSysCustomQuartzService.updateCustomQuartz(tbSysCustomQuartz);
		
		return ret;				
	}
	
	@ApiDesc("删除自定义定时器")
	@RequestMapping(value="/deletecustomquartz")
	public Object deleteCustomQuartz(HttpServletRequest request,TbSysCustomQuartz tbSysCustomQuartz) {
		
		ResponseEntity<String> ret = mpTbSysCustomQuartzService.deleteCustomQuartz(tbSysCustomQuartz);
		
		return ret;				
	}

}

